<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>RandomData</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">RandomData()</font></b></p>
<p><b>语法</b></p><blockquote>
<font color="#3A3966"><b>RandomData</b></font>(*Buffer, Length)</blockquote>

</blockquote>
<b>概要</b><br><blockquote>



Fills the specified memory buffer with random data. 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>*Buffer</i></td>
<td width="90%"> 
 
The memory address of the buffer to fill. 

 

</td></tr>
<tr><td><i>Length</i></td>
<td> 
 
The size of the buffer to fill. 

 

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>
无.


</blockquote><p><b>备注</b></p><blockquote>



This command uses the same random seed as the 
<a href="random.html">Random()</a> command. <a href="randomseed.html">RandomSeed()</a> may be used to change the random number seed. 
<br>
<br>
<b>Note:</b> This command uses a pseudorandom number generator which is very fast and produces 
randomly looking output but it is not strong enough for cryptographic purposes. 
The slower <a href="../cipher/cryptrandomdata.html">CryptRandomData()</a> command can be used if more secure 
random number generation is required. 

 

</blockquote><p><b>示例</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <font color="#3A3966">; Create an image with random content</font>
  <font color="#3A3966">;</font>
<font color="#3A3966">  CreateImage</font>(0, 200, 200)
  <b><font color="#3A3966">If</font></b> <font color="#3A3966">StartDrawing</font>(<font color="#3A3966">ImageOutput</font>(0))
    *Buffer =<font color="#3A3966"> DrawingBuffer</font>()
    Pitch   =<font color="#3A3966"> DrawingBufferPitch</font>()
        
<font color="#3A3966">    RandomData</font>(*Buffer, Pitch*200)
    
<font color="#3A3966">    StopDrawing</font>()
  <b><font color="#3A3966">EndIf</font></b>
  
<font color="#3A3966">  OpenWindow</font>(0, 0, 0, 200, 200, "Random Image", <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
<font color="#3A3966">  ImageGadget</font>(0, 0, 0, 200, 200,<font color="#3A3966"> ImageID</font>(0))
  
  <b><font color="#3A3966">Repeat</font></b>
  <b><font color="#3A3966">Until</font></b> <font color="#3A3966">WaitWindowEvent</font>() = <font color="#924B72">#PB_Event_CloseWindow</font>
</font></pre>

</blockquote><p><b>参阅</b></p><blockquote>

<a href="randomseed.html">RandomSeed()</a>, <a href="random.html">Random()</a>, <a href="../cipher/cryptrandomdata.html">CryptRandomData()</a> 

</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=random.html>Random()</a> - <a href="index.html">Math Index</a> - <a href="randomseed.html">RandomSeed()</a> -&gt;<br><br>

</body></html>